home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 September / maximum-cd-2000-09.iso / Vampire the Masquerade / vampire_demo.exe / Codex.nob / ParticleMover.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  1.2 KB  |  31 lines

  1. public class ParticleMover extends Codex {
  2.    private CodexThing _mover;
  3.    private CodexThing _particleThing;
  4.    private float _speed = 1200.0F;
  5.    private float[] offset = new float[3];
  6.    public static String[] _params = new String[]{"Particle Emitter", "Speed:1200.0"};
  7.  
  8.    public ParticleMover(CodexThing particleThing, float speed) {
  9.       this._particleThing = new CodexThing(((Codex)particleThing).GetGUID());
  10.       this._speed = speed;
  11.    }
  12.  
  13.    public void beginscene(int clientGuid, int captureID) {
  14.       this._mover = new CodexThing(((Codex)this).GetClassThing());
  15.       this.offset[0] = 0.0F;
  16.       this.offset[1] = 0.0F;
  17.       this.offset[2] = 0.0F;
  18.       this._mover.AttachThing(this._particleThing.GetGUID(), -1, this.offset, 1);
  19.       this._mover.MoveToFrame(1, this._speed);
  20.    }
  21.  
  22.    public void arrived(int thingGuid, int frameNum, int captureID) {
  23.       if (frameNum + 1 < this._mover.GetNumFrames()) {
  24.          this._mover.MoveToFrame(frameNum + 1, this._speed);
  25.       } else {
  26.          this._mover.MoveToFrame(0, this._speed);
  27.       }
  28.  
  29.    }
  30. }
  31.